package javacode.chapter05;

import java.util.Scanner;

public class Example5_1 {
    public static void main(String[] args) {
        // 计算5位学生Java课程的成绩平均分
        int[] scores = new int[5];
        int sum = 0;
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 5; i++) {
            System.out.print("请输入第" + (i + 1) + "个学生的Java课程成绩：");
            int score = scanner.nextInt();
            scores[i] = score;
            sum += score;
        }
        System.out.println("5位学生的Java课程成绩平均分是：" + (double) sum / scores.length);
    }
}
